package pri.zjy.interview;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @author zhangjy
 * @description
 * @date 2025/5/20 15:56
 */
public class Test3 {

    public static void main(String[] args) {
        ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(5, 10, 100, TimeUnit.SECONDS, new ArrayBlockingQueue<>(10));

        int count = 2;
        threadPoolExecutor.execute(new Runnable() {
            @Override
            public void run() {
                try {
                    System.out.println(Thread.currentThread().getName() + "_" + Thread.currentThread().getId());
//                    System.out.println(1);
                    System.out.println(1/ 0);
//                    throw new RuntimeException();
                } catch (Exception e) {
                    e.printStackTrace();
                }

            }
        });
    }
}
